package com.ardo.controller;


import com.ardo.service.ShopService;
import com.ardo.utils.AppUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/shop")
public class ShopController {

    @Autowired
    private ShopService shopService;

    /**
     * 分店列表查询
     * 接口编号 D001
     * 传入的坐标系为wgs84
     * @param request
     * @return
     */
    @RequestMapping("/subshop/list")
    public String subshopList(HttpServletRequest request) {
        AppUtils.printTitle("D001 - 分店列表查询");
        String curlatitude  = request.getParameter("curlatitude");
        String curlongitude  = request.getParameter("curlongitude");
        String nameLike  = request.getParameter("nameLike");
        //curlatitude:39.12827 curlongitude:117.25228 nameLike:
        System.out.println("curlatitude:" + curlatitude+" curlongitude:"+curlongitude+" nameLike:"+nameLike);
        String result = shopService.queryShopList(curlongitude, curlatitude, nameLike);
        System.out.println("分店列表查询结果: " + result);
        return result;
    }
}
